package cn.hznc.repository;
import cn.hznc.domain.entity.ToolInventoryLocationEntity;
import cn.hznc.domain.entity.ToolPartEntity;
import cn.hznc.domain.request.inventory.InventoryManageDetailReq;
import cn.hznc.domain.request.inventory.OutBoundAssemblyReq;
import cn.hznc.domain.request.inventory.ToolPartsManageReq;
import cn.hznc.domain.request.schedule.QryDirectRetrievalReq;
import cn.hznc.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Author：Administrator
 * @Date：2023/3/28 9:36
 */
public interface ToolInventoryLocationRespository {

    List<ToolInventoryVo> selectList(ToolPartsManageReq toolPartsManageReq);

    List<AssemblyToolInventoryVo> selectAssemblyToolList(ToolPartsManageReq toolPartsManageReq);

    List<AssemblyToolInventoryVo> selectAssemblyToolShelvesList(ToolPartsManageReq toolPartsManageReq);

    List<EntryAndExitRecordVo> getEntryAndExitRecord(InventoryManageDetailReq inventoryManageDetailReq);


    List<Map<String, Object>> getLocationNum(InventoryManageDetailReq inventoryManageDetailReq);

    ToolInventoryLocationEntity queryOne(ToolInventoryLocationQueryVo queryVo);


    Integer getPhysicalInventory(Integer inventoryLocationId, Integer toolId);

    Integer queryAssemblyToolId(Integer id);

    ToolInventoryLocationEntity selectOne(@Param("locationId") Integer locationId,@Param("toolNo") String toolNo);


    List<LocationNameVo> selectLocationByAssemBlyToolId(Integer id);

    ToolInventoryLocationEntity selectOneByToolTypeAndLocationId(@Param("partno") String partno,@Param("locationId") Integer toolLocationId);

    List<ToolPartEntity> selectOutboundList(Integer id);

    Integer selectOutboundRecord(OutBoundAssemblyReq  outBoundAssemblyReq);

    ToolInventoryLocationEntity selectOneTool(@Param("locationId") Integer locationId , @Param("partno") String partno);
    ToolInventoryLocationEntity selectOneToolReload(@Param("locationId") Integer locationId , @Param("partno") String partno);

    List<ToolInventoryVo> getToolPartsManageShelvesList(ToolPartsManageReq toolPartsManageReq);

    Map<String, Integer> getlocationInventoryStatus(@Param("endDate") String endDate,@Param("toolId") Integer toolId,@Param("assemblyToolId") Integer assemblyToolId , @Param("inventoryLocationId")Integer inventoryLocationId);

    Integer selectStockNumber(@Param("toolId") Integer id);

    void deleteByCondition(@Param("warehouseIds")List<Integer> warehouseIds);

    List<ToolInventoryLocationEntity> countByInventoryLocationId();

    List<DirectRetrievalVo> queryDirectRetrievalToolIndex(QryDirectRetrievalReq qryDirectRetrievalReq);

    List<DirectRetrievalVo> queryDirectRetrievalAssemblyToolIndex(QryDirectRetrievalReq qryDirectRetrievalReq);

    List<ToolInventoryLocationEntity> selectListByConditions(List<String> groupIds);
}
